import jwt from "jsonwebtoken";
import { jwtSecret } from "../config";

export function genToken(obj) {
  return jwt.sign(obj, jwtSecret);
}

export function genAppToken(id, opts) {
  return genToken({
    id,
    t: (Date.now() / 1000) | 0,
    ...opts,
  });
}
